<!--部门弹出层-->
<input type="hidden" id="nowSelectedNode${serializeNum}">
<div id="dialogDeptDirTree${serializeNum}" class="tree" style="min-height: 400px">
    <div class="tree-folder" style="display: none;">
        <div class="tree-folder-header">
            <i class="fa fa-folder yellow"></i>
            <div class="tree-folder-name">
            </div>
        </div>
        <div class="tree-folder-content"></div>
        <div class="tree-loader" style="display: none;"></div>
    </div>
    <div class="tree-item" style="display: none;">
        <i class="tree-dot"></i>
        <div class="tree-item-name"></div>
    </div>
</div>
<div class="row customer-modal-footer">
    <a class="closeBtn${serializeNum}" data-dismiss="modal" aria-hidden="true"></a>
    <button type="button" class="btn btn-blue " onclick="closeDeptDialog()">取消</button>
    <button type="submit" class="btn btn-danger" onclick="confirmSelected()" ondblclick="false">确定</button>
</div>
<script type="text/javascript">
    //延迟加载部门结构树
    loadAjaxTree("dialogDeptDirTree${serializeNum}", 0);

    $("#dialogDeptDirTree${serializeNum}").on("selected", function (evt, data) {
        console.log("item selected: ", data);
        var dept = data["info"][0].params;
        $("#nowSelectedNode${serializeNum}").val(JSON.stringify(dept));
    });

    /**
     * 关闭部门弹出选择层
     * */
    function closeDeptDialog() {
        $(".closeBtn${serializeNum}").click();
        if ($("body .bootbox.modal").size() > 0) {
            $("body").addClass("modal-open");
        }
    }

    /**
     * 确认选择的部门
     */
    function confirmSelected() {
        var callbackName = "${callbackName[0]}";
        if (callbackName) {
            var selectedDept = $("#nowSelectedNode${serializeNum}").val();
            if (selectedDept) {
                ${callbackName[0]}(eval("(" + selectedDept + ")"));
            }
        }
        closeDeptDialog();
    }
</script>